{extend name="base"/}
{block name="title"}
我的
{/block}
{block name="css"}
<link rel="stylesheet" href="__MOBILE__/css/yuanMy.css"/>
{/block}
{block name="content"}
<article class="htmleaf-container" style="display:none;">
		<div id="clipArea">
			   
		</div>
		<div class="foot-use">
			<div class="uploader1 blue">
				<input type="button" name="file" class="button input" value="打开"/>
				<form id='myupload' action="" method='post' enctype='multipart/form-data'>
					<input id="file" type="file"  name="uploadfile" onchange="javascript:setImagePreview();" accept="image/*" multiple  />
				</form>
			</div>
			<button id="clipBtn">确认</button>
			<button id="set_cell">取消</button>
		</div>
		<div id="view"></div>
</article>

<div class="header">
    <div class="message"><a href="{:url('/langjinmobile/my/usermessage')}"><img src="__MOBILE__/images/xiaoxi.png" alt=""></a></div>
    <div class="myInfo">
        <div class="headport half">
			<a class="logo" id="logox">
				{if $userinfo.head_img}
				<img src="{$userinfo.head_img}" alt="">
				{else /}
				<img src="__MOBILE__/images/touxiang.png" alt="">
				{/if}
			</a>
		</div>
        <div class="myData">
            <p>ID: {$userinfo.id} 　　<span><img src="__MOBILE__/images/fenxiaoshang.png" alt="">{$user_level}</span></p>
            <p>{$userinfo.mobile}</p>
        </div>
        <div class="qrCode">
			<a href="{:url('/langjinmobile/home/qrcode')}">
				<img src="__MOBILE__/images/erweim.png" alt="">
			</a>
		</div>
    </div>
</div>

<!-- 钱包 -->
<div class="myorder">
	<div class="title">我的钱包</div>
	<div class="liner"></div>
	<ul class="flexbox">
		<li>
			<a href="{:url('/langjinmobile/home/balance')}">
				<h2>{$money.balance}</h2>
				<p>GMOB</p>
			</a>
		</li>
		<li>
			<a href="{:url('/langjinmobile/home/integral')}">
				<h2>{$money.integral}</h2>
				<p>GMOD</p>
			</a>
		</li>
		<li>
			<a href="{:url('/langjinmobile/home/xingji_shouyi')}">
				<h2>{$xingji_shouyi}</h2>
				<p>星级收益</p>
			</a>
			</li>
		<li>
			<a href="{:url('/langjinmobile/home/juxing_shouyi')}">
			<h2>{$juxing_shouyi}</h2>
			<p>矩形收益</p>
			</a>
		</li>
	</ul>
</div>

<!-- 订单 -->
<div class="myorder wallet">
		<div class="title">我的订单</div>
		<div class="liner"></div>
		<ul class="flexbox">
			<li>
				<a href="{:url('/langjinmobile/card/order/status/1')}">
					<img src="__MOBILE__/images/dengdai.png" alt="">
					<p>已付款</p>
				</a>
			</li>
			<li>
				<a href="{:url('/langjinmobile/card/order/status/2')}">
				<img src="__MOBILE__/images/daishouhuo.png" alt="">
				<p>已发货</p>
				</a>
			</li>
			<li>
				<a href="{:url('/langjinmobile/card/order/status/3')}">
				<img src="__MOBILE__/images/daipingjia.png" alt="">
				<p>已完成</p>
				</a>
			</li>
		</ul>
	</div>

<!-- 星级管理 -->
<div class="myorder wallet">
		<div class="title">星级管理</div>
		<div class="liner"></div>
		<ul class="flexbox">
			<li>
				<a href="{:url('/langjinmobile/my/starmap')}">
					<img src="__MOBILE__/images/xingone.png" alt="">
					<p>星级图谱</p>
				</a>
			</li>
			<li>
				<a href="{:url('/langjinmobile/home/xingji_shouyi')}">
				<img src="__MOBILE__/images/xing2.png" alt="">
				<p>星级收益</p>
				</a>
			</li>
			<li>
				<a href="{:url('/langjinmobile/home/qrcode')}">
				<img src="__MOBILE__/images/xing3.png" alt="">
				<p>分享赚钱</p>
				</a>
			</li>
		</ul>
	</div>

<!-- 应用 -->
<div class="myorder wallet yingyong">
		<div class="title">我的应用</div>
		<div class="liner"></div>
		<ul>
			<li>
				<a href="{:url('/langjinmobile/my/marea')}">
				<img src="__MOBILE__/images/weodegongpai.png" alt="">
				<p>我的公排</p>
				</a>
			</li>
			
			<li>
					<a href="#">
					<img src="__MOBILE__/images/yuezhuanr.png" alt="">
					<p>GMOB转入</p>
					</a>
				</li>
				
			<!--<li>
				<a href="{:url('/langjinmobile/my/sharerecord')}">
				<img src="__MOBILE__/images/fenhongjil.png" alt="">
				<p>分红记录</p>
				</a>
			</li>
			<li class="quchong">
				<a href="{:url('/langjinmobile/card/distr')}">
				<img src="__MOBILE__/images/fenxiaojil.png" alt="">
				<p>分销记录</p>
				</a>
			</li>-->
	
			<!--<li>
				<a href="{:url('/langjinmobile/team/myteam')}">
				<img src="__MOBILE__/images/tuandui.png" alt="">
				<p>我的团队</p>
				</a>
			</li>-->
			<li>
				<a href="{:url('/langjinmobile/my/unactivated')}">
					<img src="__MOBILE__/images/shequ.png" alt="">
					<p>社区中心</p>
				</a>
			</li>
			<li class="quchong">
					<a href="{:url('/langjinmobile/Merchant/apply')}">
					<img src="__MOBILE__/images/shome.png" alt="" style="height:.55rem;">
					<p>商家入驻</p>
					</a>
				</li>
			<li class="quchong">
				<a href="{:url('/langjinmobile/home/setting')}">
				<img src="__MOBILE__/images/shezhi.png" alt="">
				<p>个人设置</p>
				</a>
			</li>
		
		</ul>
	</div>

{if $bis_status !=0}
<!-- 商家管理 -->
<div class="myorder wallet">
	<div class="title">商家管理</div>
	<div class="liner"></div>
	<ul>
		<li>
			<a href="{:url('/langjinmobile/Merchant/productList')}">
			<img src="__MOBILE__/images/quanbushangpin.png" alt="">
			<p>全部商品</p>
			</a>
		</li>
		<li>
			<a href="{:url('/langjinmobile/Merchant_order/index')}">			
			<img src="__MOBILE__/images/dingdanguanli.png" alt="">
			<p>订单管理</p>
			</a>
		</li>
		<li>
			<a href="{:url('/langjinmobile/Merchant/showAdd')}">		
			<img src="__MOBILE__/images/shangpinguanli.png" alt="">
			<p>商品管理</p>
		</a>
		</li>
		<!-- <li>
			<a href="{:url('/langjinmobile/merchandise/recruitment')}">		
			<img src="__MOBILE__/images/shangjiaziliao.png" alt="">
			<p>商家资料</p>
			</a>	
		</li> -->
	</ul>
</div>
{/if}

<!-- 退出 -->
<div class="exitBtn">退出登录</div>
<!-- 底部 -->
<div class="footer">
	<a href="{:url('/langjinmobile/home/index')}">
		<img src="__MOBILE__/images/footer1.png" alt="">
		<p>首页</p>
	</a>
	<a href="{:url('/langjinmobile/classify/index')}">
		<img src="__MOBILE__/images/footer3.png" alt="">
		<p>分类</p>
	</a>
	<a href="{:url('/langjinmobile/card/shopcard')}">
		<img src="__MOBILE__/images/footer5.png" alt="">
		<p>购物车</p>
	</a>
	<a href="{:url('/langjinmobile/my/my')}" class="active">
		<img src="__MOBILE__/images/footer8.png" alt="">
		<p>我的</p>
	</a>
</div>
{/block}
{block name="js"}
<script src="__MOBILE__/js/iscroll-zoom.js"></script>
<script src="__MOBILE__/js/hammer.js"></script>
<script src="__MOBILE__/js/jquery.photoClip.js"></script>


<script>
		var obUrl = ''
		//document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
		$("#clipArea").photoClip({
			width: 200,
			height: 200,
			file: "#file",
			view: "#view",
			ok: "#clipBtn",
			loadStart: function() {
				console.log("照片读取中");
			},
			loadComplete: function() {
				console.log("照片读取完成");
			},
			clipFinish: function(dataURL) {
				// console.log(dataURL);
			}
		});
	
	
		$(function(){
			$("#logox").click(function(){
				$(".htmleaf-container").show();
				// $(".photo-clip-view").css("background","#fff");
				$(".photo-clip-view").css("width","200px");
				$(".photo-clip-view").css("height","200px");
				$(".photo-clip-view").css("border-radius","50%");
				$(".photo-clip-view").css("top","3.12rem");
				$(".photo-clip-view").css("left","3.72rem");
	
			   
				$(".photo-clip-mask").css("width","200px");
				$(".photo-clip-mask").css("height","200px");
				$(".photo-clip-mask").css("top","1.3rem");
				$(".photo-clip-mask").css("left","1.9rem");
	
	
				$(".photo-clip-area").css("width","200px");
				$(".photo-clip-area").css("height","200px");
				$(".photo-clip-area").css("top","1.83rem");
				$(".photo-clip-area").css("left","1.83rem");
				$(".photo-clip-area").css("border-radius","50%");
				$(".photo-clip-area").css("border-color","#ff992e");
				$(".photo-clip-area").addClass(".bor_box");
				
				
				$(".photo-clip-rotateLayer").css("width","200px");
				$(".photo-clip-rotateLayer").css("height","200px");
				$(".photo-clip-rotateLayer").css("margin-top","-2rem");
				$(".photo-clip-rotateLayer").css("left","2rem");   
	
				$(".photo-clip-moveLayer").css("margin-top","2rem");
				$(".photo-clip-moveLayer").css("left","2rem");
				
				
	
			})
			$("#clipBtn").click(function(){
				//数据流上传开始执行图片上传
				$.ajax({
					url:'/langjinmobile/my/imgUps',
					type:'post',
					data:{'dataflow':imgsource},
					datatype:'json',
					success:function (data) {
						console.log(data);
					   if(data.code == 1){
							$("#logox").empty();
							$('#logox').append('<img src="' + imgsource + '" align="absmiddle" style=" width:1.5rem;height: 1.5rem;">');
							$(".htmleaf-container").hide();
							msg_alert(data.mes);
						}else{
							msg_alert(data.mes);
						}
					}
				})
			})
		});
	</script>
	<script type="text/javascript">
		$(function(){
			jQuery.divselect = function(divselectid,inputselectid) {
				var inputselect = $(inputselectid);
				$(divselectid+" small").click(function(){
					$("#divselect ul").toggle();
					$(".mask").show();
				});
				$(divselectid+" ul li a").click(function(){
					var txt = $(this).text();
					$(divselectid+" small").html(txt);
					var value = $(this).attr("selectid");
					inputselect.val(value);
					$(divselectid+" ul").hide();
					$(".mask").hide();
					$("#divselect small").css("color","#333")
				});
			};
			$.divselect("#divselect","#inputselect");
		});
	</script>
	<script type="text/javascript">
		function setImagePreview() {
			var preview, img_txt, localImag, file_head = document.getElementById("file_head"),
				picture = file_head.value;
	
			if (!picture.match(/.jpg|.gif|.png|.bmp/i)) return alert("您上传的图片格式不正确，请重新选择！"),
				!1;
			if (preview = document.getElementById("preview"), file_head.files && file_head.files[0]) preview.style.display = "block",
				preview.style.width = "63px",
				preview.style.height = "63px",
				preview.src = window.navigator.userAgent.indexOf("Chrome") >= 1 || window.navigator.userAgent.indexOf("Safari") >= 1 ? window.webkitURL.createObjectURL(file_head.files[0]) : window.URL.createObjectURL(file_head.files[0]);
			else {
				file_head.select(),
					file_head.blur(),
					img_txt = document.selection.createRange().text,
					localImag = document.getElementById("localImag"),
					localImag.style.width = "63px",
					localImag.style.height = "63px";
				try {
					localImag.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)",
						localImag.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = img_txt
				} catch(f) {
					return alert("您上传的图片格式不正确，请重新选择！"),
						!1
				}
				preview.style.display = "none",
					document.selection.empty()
			}
			return document.getElementById("DivUp").style.display = "block",
				!0
		}
		//关闭头像上传
		$('#set_cell').click(function(){
			$('.htmleaf-container').hide()
		})
		// 退出登录
		$('.exitBtn').click(function(){
	     $.ajax({                                            
            url:"{:url('/langjinmobile/registered/logout')}",
            type:'POST',
            dataType:'json',
            success:function(res){
                //console.log(res);
                if(res.code==1){
                    msg_alert("{:lang('退出成功')}",res.url);
                }else{
                    msg_alert(res.msg)
                }
            }
        })
		})
	</script>


{/block}